#ifndef UPDATE_PAGE_H
#define UPDATE_PAGE_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "PropPage.h"
#include "../client/UpdateManager.h"

class UpdatePage : public CPropertyPage<IDD_UPDATE_PAGE>, public PropPage, private UpdateManagerListener
{
public:
	enum { WM_PROFILE = WM_APP + 53 };

	UpdatePage(SettingsManager *s) : PropPage(s), uc(0), prog(0) { 
		SetTitle(CTSTRING(SETTINGS_UPDATE_PAGE));
	};

	virtual ~UpdatePage() { };

	BEGIN_MSG_MAP(UpdatePage)
		MESSAGE_HANDLER(WM_INITDIALOG, onInitDialog)
		COMMAND_ID_HANDLER(IDC_UPDATE, onBtn)
		COMMAND_ID_HANDLER(IDC_LOAD_BACKUP, onBtn)
	END_MSG_MAP()

	LRESULT onInitDialog(UINT, WPARAM, LPARAM, BOOL&);
	LRESULT onBtn(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/);
	//LRESULT onLoad(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

	// Common PropPage interface
	PROPSHEETPAGE *getPSP() { return (PROPSHEETPAGE *)*this; }
	virtual void write();

private:
	virtual void on(UpdateManagerListener::Types type, int file) throw();
	void getActivated();
	void uncheck(int id){ 
		CButton tmp;
		tmp.Attach(GetDlgItem(id));
		tmp.SetCheck(BST_UNCHECKED);
		tmp.Detach();
	}
	StringIntMap updateItems;
	CProgressBarCtrl progress;
	string getText(int id);
	static Item items[];
	int uc;
	int prog;

};
#endif
/**
 * @file
 * $Id: UpdatePage.h 303 2005-08-18 23:46:43Z sulan $
 */